package cn.virens.util;

import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;

import java.io.IOException;

public class ResourceUtil {
    public static Resource getResource(String location) {
        return resolver().getResource(location);
    }

    public static Resource[] getResources(String locationPattern) throws IOException {
        return resolver().getResources(locationPattern);
    }

    public static PathMatchingResourcePatternResolver resolver() {
        return new PathMatchingResourcePatternResolver();
    }
}
